package server;

import java.security.Security;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

import serverPresentation.LoginMenu;
import threads.ConnectionInitiatorThread;

public class CertcopServer {
	
	static{
		Security.addProvider(new BouncyCastleProvider());
	};

	private ConnectionInitiatorThread _connectionThread;
	private ServerData _serverData;

	public CertcopServer(){
		_serverData = new ServerData("W2g4xmF8kc");
		_connectionThread = new ConnectionInitiatorThread();		
	}

	private void run(){
		
		LoginMenu login = new LoginMenu(_serverData);	
		login.setVisible(true);
		
		boolean logon = _serverData.isLoggedOn();
		
		if(logon){
			_connectionThread.start();
		}
	}

	public static void main(String[] args){
		CertcopServer certcopServer = new CertcopServer();
		certcopServer.run();
	}
}
